# eric7.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleTopicChecker

Module implementing the topic checker base class containing common methods.

### Global Attributes

None

### Classes

CodeStyleTopicChecker | Class implementing the topic checker base class.

### Functions

None

## CodeStyleTopicChecker

Class implementing the topic checker base class.

### Derived from

None

### Class Attributes

None

### Class Methods

None

### Methods

CodeStyleTopicChecker | Constructor
_ignoreCode | Protected method to check if the message code should be ignored.
_initializeCheckers | Protected method to determine the list of check methods to be run.
addError | Public method to record an issue.
addErrorFromNode | Public method to record an issue given the faulty ast node.
run | Public method to execute the relevant checks.

### Static Methods

None

#### CodeStyleTopicChecker (Constructor)

CodeStyleTopicChecker(category, source, filename, tree, select, ignore, expected, repeat, args)

Constructor

category (str)
  checker category code (one to three uppercase characters
source (list of str)
  source code to be checked
filename (str)
  name of the source file
tree (ast.Module)
  AST tree of the source code
select (list of str)
  list of selected codes
ignore (list of str)
  list of codes to be ignored
expected (list of str)
  list of expected codes
repeat (bool)
  flag indicating to report each occurrence of a code
args (dict)
  dictionary of arguments for the various checks

#### CodeStyleTopicChecker._ignoreCode

_ignoreCode(code)

Protected method to check if the message code should be ignored.

code (str)
  message code to check for

Return:
  flag indicating to ignore the given code

Return Type:
  bool

#### CodeStyleTopicChecker._initializeCheckers

_initializeCheckers(checkersWithCodes)

Protected method to determine the list of check methods to be run.

This list is determined considering the list if selected and ignored issue codes.

checkersWithCodes (TYPE)
  DESCRIPTION

#### CodeStyleTopicChecker.addError

addError(lineNumber, offset, msgCode, *args)

Public method to record an issue.

lineNumber (int)
  line number of the issue (one based)
offset (int)
  position within line of the issue
msgCode (str)
  message code
args (list)
  arguments for the message

#### CodeStyleTopicChecker.addErrorFromNode

addErrorFromNode(node, msgCode, *args)

Public method to record an issue given the faulty ast node.

node (ast.AST)
  reference to the node containing the issue
msgCode (str)
  message code
args (list)
  arguments for the message

#### CodeStyleTopicChecker.run

run()

Public method to execute the relevant checks.

Up